﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Core;
using System.Data;
using Data.Controllers;

namespace Data.DBOES
{
    [TableAttribute("NhatKyBanHang")]
    [Serializable]
   public class NhatKyBanHang:DBO<NhatKyBanHang>
    {
        private int? _IdNKBH;
        [ColumnAttribute("IdNKBH", SqlDbType.Int, 4, true, true, false)]
        public int? IdNKBH
        {
            get { return _IdNKBH; }
            set { _IdNKBH = value; }
        }
        private DateTime? _NgayBan;
        [ColumnAttribute("NgayBan", SqlDbType.DateTime, 8, false, false, true)]
        public DateTime? NgayBan
        {
            get { return _NgayBan; }
            set { _NgayBan = value; }
        }
        private string _ChuHang;
        [ColumnAttribute("ChuHang", SqlDbType.NVarChar, 3000, false, false, true)]
        public string ChuHang
        {
            get { return _ChuHang; }
            set { _ChuHang = value; }
        }
        private string _DiaChi;
        [ColumnAttribute("DiaChi", SqlDbType.NVarChar, 3000, false, false, true)]
        public string DiaChi
        {
            get { return _DiaChi; }
            set { _DiaChi = value; }
        }
        private int? _IdKhachHang;
        [ColumnAttribute("IdKhachHang", SqlDbType.Int, 4, false, false, true)]
        public int? IdKhachHang
        {
            get { return _IdKhachHang; }
            set { _IdKhachHang = value; }
        }
        private Boolean? _ThanhToan;
        [ColumnAttribute("ThanhToan", SqlDbType.Bit, 1, false, false, true)]
        public Boolean? ThanhToan
        {
            get { return _ThanhToan; }
            set { _ThanhToan = value; }
        }
        private string _SoXeTangBo;
        [ColumnAttribute("SoXeTangBo", SqlDbType.NVarChar, 50, false, false, true)]
        public string SoXeTangBo
        {
            get { return _SoXeTangBo; }
            set { _SoXeTangBo = value; }
        }
        private Double? _CuocXeTangBo;
        [ColumnAttribute("CuocXeTangBo", SqlDbType.Float, 4, false, false, true)]
        public Double? CuocXeTangBo
        {
            get { return _CuocXeTangBo; }
            set { _CuocXeTangBo = value; }
        }
        private string _DiaDiemTangBo;
        [ColumnAttribute("DiaDiemTangBo", SqlDbType.NVarChar, 300, false, false, true)]
        public string DiaDiemTangBo
        {
            get { return _DiaDiemTangBo; }
            set { _DiaDiemTangBo = value; }
        }
        private Double? _SoLuong;
        [ColumnAttribute("SoLuong", SqlDbType.Float, 4, false, false, true)]
        public Double? SoLuong
        {
            get { return _SoLuong; }
            set { _SoLuong = value; }
        }
        private string _SoXeVanChuyen;
        [ColumnAttribute("SoXeVanChuyen", SqlDbType.NVarChar, 50, false, false, true)]
        public string SoXeVanChuyen
        {
            get { return _SoXeVanChuyen; }
            set { _SoXeVanChuyen = value; }
        }
        private Double? _CuocXeVanChuyen;
        [ColumnAttribute("CuocXeVanChuyen", SqlDbType.Float, 4, false, false, true)]
        public Double? CuocXeVanChuyen
        {
            get { return _CuocXeVanChuyen; }
            set { _CuocXeVanChuyen = value; }
        }
        private string _SanPham;
        [ColumnAttribute("SanPham", SqlDbType.NVarChar, 300, false, false, true)]
        public string SanPham
        {
            get { return _SanPham; }
            set { _SanPham = value; }
        }
        private Double? _GiaNhap;
        [ColumnAttribute("GiaNhap", SqlDbType.Float, 4, false, false, true)]
        public Double? GiaNhap
        {
            get { return _GiaNhap; }
            set { _GiaNhap = value; }
        }
        private Double? _GiaBaoBiBocVac;
        [ColumnAttribute("GiaBaoBiBocVac", SqlDbType.Float, 4, false, false, true)]
        public Double? GiaBaoBiBocVac
        {
            get { return _GiaBaoBiBocVac; }
            set { _GiaBaoBiBocVac = value; }
        }
        private Double? _GiaXuat;
        [ColumnAttribute("GiaXuat", SqlDbType.Float, 4, false, false, true)]
        public Double? GiaXuat
        {
            get { return _GiaXuat; }
            set { _GiaXuat = value; }
        }
        private string _NhapXuat;
        [ColumnAttribute("NhapXuat", SqlDbType.NVarChar, 50, false, false, true)]
        public string NhapXuat
        {
            get { return _NhapXuat; }
            set { _NhapXuat = value; }
        }
        private string _BenTraVanChuyen;
        [ColumnAttribute("BenTraVanChuyen", SqlDbType.NVarChar, 300, false, false, true)]
        public string BenTraVanChuyen
        {
            get { return _BenTraVanChuyen; }
            set { _BenTraVanChuyen = value; }
        }
        private string _NoThu;
        [ColumnAttribute("NoThu", SqlDbType.NVarChar, 30, false, false, true)]
        public string NoThu
        {
            get { return _NoThu; }
            set { _NoThu = value; }
        }
        private string _GhiChu;
        [ColumnAttribute("GhiChu", SqlDbType.NVarChar, 3000, false, false, true)]
        public string GhiChu
        {
            get { return _GhiChu; }
            set { _GhiChu = value; }
        }
        private string _PL;
        [ColumnAttribute("PL", SqlDbType.NVarChar, 50, false, false, true)]
        public string PL
        {
            get { return _PL; }
            set { _PL = value; }
        }
        private bool? _IsActive;
        [ColumnAttribute("IsActive", SqlDbType.Bit, 1, false, false, true)]
        public bool? IsActive
        {
            get { return _IsActive; }
            set { _IsActive = value; }
        }
        private string _HinhThucTT;
        [ColumnAttribute("HinhThucTT", SqlDbType.NVarChar, 300, false, false, true)]
        public string HinhThucTT
        {
            get { return _HinhThucTT; }
            set { _HinhThucTT = value; }
        }
        private Double? _ThanhToanTruoc;
        [ColumnAttribute("ThanhToanTruoc", SqlDbType.Float, 4, false, false, true)]
        public Double? ThanhToanTruoc
        {
            get { return _ThanhToanTruoc; }
            set { _ThanhToanTruoc = value; }
        }
        private bool? _TraCuocTB;
        [ColumnAttribute("TraCuocTB", SqlDbType.Bit, 1, false, false, true)]
        public bool? TraCuocTB
        {
            get { return _TraCuocTB; }
            set { _TraCuocTB = value; }
        }
        private bool? _TraCuocVC;
        [ColumnAttribute("TraCuocVC", SqlDbType.Bit, 1, false, false, true)]
        public bool? TraCuocVC
        {
            get { return _TraCuocVC; }
            set { _TraCuocVC = value; }
        }
        private bool? _TraTienMuoiNhap;
        [ColumnAttribute("TraTienMuoiNhap", SqlDbType.Bit, 1, false, false, true)]
        public bool? TraTienMuoiNhap
        {
            get { return _TraTienMuoiNhap; }
            set { _TraTienMuoiNhap = value; }
        }
        public Membership KhachHang
        {
            get
            {
                if (this.IdKhachHang == null)
                    return null;

                Membership condition = new Membership(this.IdKhachHang);
                return MembershipController.FindItem(condition);
            }
        }
        public NhatKyBanHang()
        { }
        public NhatKyBanHang(int? IdNKBH)
        {
            this.IdNKBH = IdNKBH;
        }
        public NhatKyBanHang(int? IdNKBH,DateTime? NgayBan,string ChuHang,string DiaChi,int? IdKhachHang,Boolean? ThanhToan,string SoXeTangBo,float? CuocXeTangBo,string DiaDiemTangBo,float? SoLuong,string SoXeVanChuyen,float? CuocXeVanChuyen,string SanPham,float? GiaNhap,float? GiaBaoBiBocVac,float? GiaXuat,string NhapXuat,string BenTraVanChuyen,string NoThu,string GhiChu,bool? IsActive)
        { 
            this.IdNKBH=IdNKBH;
            this.NgayBan = NgayBan;
            this.ChuHang = ChuHang;
            this.DiaChi = DiaChi;
            this.IdKhachHang = IdKhachHang;
            this.ThanhToan = ThanhToan;
            this.SoXeTangBo = SoXeTangBo;
            this.CuocXeTangBo = CuocXeTangBo;
            this.DiaDiemTangBo = DiaDiemTangBo;
            this.SoLuong = SoLuong;
            this.SoXeVanChuyen = SoXeVanChuyen;
            this.CuocXeVanChuyen = (float)CuocXeVanChuyen;
            this.SanPham = SanPham;
            this.GiaNhap = GiaNhap;
            this.GiaBaoBiBocVac = GiaBaoBiBocVac;
            this.GiaXuat = GiaXuat;
            this.NhapXuat = NhapXuat;
            this.BenTraVanChuyen = BenTraVanChuyen;
            this.NoThu = NoThu;
            this.GhiChu = GhiChu;
            this.IsActive = IsActive;
        }
    }
}
